﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using UFSSWebApp.UFSSservicereference;

namespace UFSSWebApp
{
    public partial class profile : System.Web.UI.Page
    {
        UFSSservicereference.UserCreds uc = new UFSSservicereference.UserCreds();
        UFSSservicereference.UFSSserviceSoapClient ussc = new UFSSservicereference.UFSSserviceSoapClient();

        protected void Page_Load(object sender, EventArgs e)
        {
            uc = (UFSSservicereference.UserCreds)Session["usercreds"];
            ArrayOfString info = new ArrayOfString();
            info.AddRange(ussc.getUserInfo(uc));

            string email = info[3].ToString();
            string[] emailHide = new string[2];
            string ast = "";
            int num = 0;
            emailHide = email.Split('@');
            num = emailHide[0].Length;
            for (int i = 0; i < num; i++)
                ast += "*";
            
            lblFName.Text = info[1].ToString();
            lblLName.Text = info[2].ToString();
            lblEmail.Text = ast + "@" + emailHide[1].ToString(); ;

            lblFiles.Text = ussc.getUserStat(uc, "FileCount").ToString();
            lblFriends.Text = ussc.getUserStat(uc, "FriendCount").ToString();
            lblSubs.Text = ussc.getUserStat(uc, "SubCount").ToString();
        }
    }
}